cmake_minimum_required(VERSION 2.8)
include(depend_directories.txt)

 
if(POLICY CMP0020)
  cmake_policy(SET CMP0020 NEW)
endif()

PROJECT(RaspberryHelicopterClient)

find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
find_package(Qt5Widgets REQUIRED QUIET)
find_package(Qt5Network REQUIRED QUIET)
find_package(Qt5Gui REQUIRED QUIET)
find_package(Qt5Xml REQUIRED QUIET)
find_package(Qt5Svg REQUIRED QUIET)
find_package(Qt5Core)
#find_package (Marble REQUIRED)
find_package(Qt5Multimedia REQUIRED QUIET)
find_package(Qt5MultimediaWidgets REQUIRED QUIET)

LINK_DIRECTORIES(${MARBLE_LINK})
LINK_DIRECTORIES(${QFLIGHT_LINK})

#"C:/raspberryHelicopter/depend/complied/qflightinstruments-20140126/release
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${MARBLE_INCLUDE_DIR} ${QFLIGHT_INCLUDE} )
include_directories(${QT5INCLUDE}/QtNetwork)
include_directories(${QT5INCLUDE}/QtXml)
include_directories(${QT5INCLUDE}/QtSvg)
include_directories(${QT5INCLUDE}/QtGui)
include_directories(${QT5INCLUDE}/QtMultimedia)
include_directories(${QT5INCLUDE}/QtMultimediaWidgets)
include_directories("../../raspberry-pi-helicopter-common/include/")
include_directories("./headers")
#include_directories("../../depend/complied/qflightinstruments-20140126")


#set (MARBLE_LIBRARIESAP marblewidget )

file(GLOB UI_FILES ./ui/*.ui)
file(GLOB QT_WRAP ./headers/*.h)
file(GLOB CXX_FILES ./cpp/*.cpp)

file(GLOB COMMON_CXX_FILES ../../raspberry-pi-helicopter-common/cpp/*.cpp)
file(GLOB COMMON_QT_WRAP ../../raspberry-pi-helicopter-common/include/*.h)
qt5_wrap_ui(UISrcs ${UI_FILES} )

add_executable(RaspberryHelicopterClient MACOSX_BUNDLE ${CXX_FILES} ${COMMON_CXX_FILES} ${UISrcs} ${QT_WRAP} ${COMMON_QT_WRAP})
qt5_use_modules(RaspberryHelicopterClient Core Gui Network Xml Multimedia MultimediaWidgets)



#add_executable(RaspberryHelicopterClient MACOSX_BUNDLE ${CXX_FILES} ${COMMON_CXX_FILES} ${UISrcs} ${MOCSrcs})
#target_link_libraries(RaspberryHelicopterClient ${VTK_LIBRARIES})
#target_link_libraries(RaspberryHelicopterClient  marblewidget )

target_link_libraries(RaspberryHelicopterClient ${VTK_LIBRARIES} ${MARBLE_LINK} ${QFLIGHT_LINK})
